import com.zhumo.sz.common.easyexcel.EasyExcelReader;
import com.zhumo.sz.entity.bus.BusLineExcel;
import com.zhumo.sz.entity.bus.BusSiteInfo;

import java.util.*;

public class A {

    public static void main(String[] args) {
        String filePath = "E:\\毕业\\code\\sz-bigdata\\data\\深圳公交数据.xlsx";
        ArrayList<BusSiteInfo> collect = new ArrayList<>();
        List<BusLineExcel> lineExcelList = EasyExcelReader.readAsList(BusLineExcel.class, filePath);
        HashSet<String> siteNameSet = new HashSet<>(); //线路站点可能重合
        for (BusLineExcel busLineExcel : lineExcelList) {
            if (Objects.nonNull(busLineExcel.getHighThroughStations()) && !busLineExcel.getHighThroughStations().equals(" ") &&
                    !busLineExcel.getHighThroughStations().equals("/")) {
                siteNameSet.addAll(Arrays.asList(busLineExcel.getHighThroughStations()
                        .replaceAll("\\s", "").split("、")));
            }
            if (Objects.nonNull(busLineExcel.getLowThroughStations()) && !busLineExcel.getLowThroughStations().equals(" ") &&
                    !busLineExcel.getHighThroughStations().equals("/")) {
                siteNameSet.addAll(Arrays.asList(busLineExcel.getLowThroughStations()
                        .replaceAll("\\s", "").split("、")));
            }

            System.out.println(siteNameSet.size());
        }
    }
}


